From: Keir Fraser Date: Wed, 17 Feb 2010 15:54:40 +0000 (+0000) Subject: tmem: When failing allocs from "midsize alloc zone", try the tmem X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12587 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=533795e7776db68d097d07e09cf8813ad85df859;p=xen.git tmem: When failing allocs from "midsize alloc zone", try the tmem pools rather than fail outright. Signed-off-by: Keir Fraser --- diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 54920ff4db..26a0ee9ba1 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -309,11 +309,11 @@ static struct page_info *alloc_heap_pages( /* * TMEM: When available memory is scarce, allow only mid-size allocations - * to avoid worst of fragmentation issues. + * to avoid worst of fragmentation issues. Others try TMEM pools then fail. */ if ( opt_tmem && ((order == 0) || (order >= 9)) && (total_avail_pages <= midsize_alloc_zone_pages) ) - goto fail; + goto try_tmem; /* * Start with requested node, but exhaust all node memory in requested @@ -340,6 +340,7 @@ static struct page_info *alloc_heap_pages( node = first_node(node_online_map); } + try_tmem: /* Try to free memory from tmem */ if ( (pg = tmem_relinquish_pages(order,memflags)) != NULL ) { @@ -348,7 +349,6 @@ static struct page_info *alloc_heap_pages( return pg; } - fail: /* No suitable memory blocks. Fail the request. */ spin_unlock(&heap_lock); return NULL;